Some video output devices can display video simultaneously on an external video display and in a window on a computer's desktop. To use this feature, your software draws to a graphics port for the window on the computer's desktop, known as the echo port, rather than the port that is normally used for the video output device. The video then appears on both displays, although in some cases the video on the desktop is displayed at a smaller size or lower frame rate.
To draw to both outputs at the same time, do the following:
This process is shown in Listing 3 .
Listing 3Drawing to an echo port
Movie aMovie;
ComponentInstance ci;
CGrafPtr thePort;
/* instantiation of the video output component here */
/* creation of the graphics port here */
if (ComponentFunctionImplemented(ci, kQTVideoOutputSetEchoPortSelect)) {
result = QTVideoOutputSetEchoPort(ci, thePort);
SetMovieGWorld (aMovie, thePort, nil);
StartMovie (aMovie);
}
The video then appears on both displays. Note that you bypass the graphics world that is normally used for the video output device; your software draws only to the echo port you specify with the QTVideoOutputSetEchoPort function.